#!/bin/sh
basepath=$(cd `dirname $0`; pwd)
cd ${basepath}
cd ..

echo "拉取代码...\n"
git pull

echo "安装依赖包...\n"
yarn install

echo "编译打包文件...\n"
yarn run build

echo  "上传服务器...\n"
# 官网项目
#scp -r -i deploy/cloud.xuexuejava.cn-43.138.198.140.pem dist/* root@43.138.198.140:/usr/share/nginx/html/xuexuejava.cn/

# 后台系统
#scp -r -i deploy/cloud.xuexuejava.cn-43.138.198.140.pem dist/* root@43.138.198.140:/usr/share/nginx/html/cloud.xuexuejava.cn/

# 推荐项目
scp -r -i deploy/cloud.xuexuejava.cn-43.138.198.140.pem dist/* root@43.138.198.140:/usr/share/nginx/html/tui.xuexuejava.cn/

echo  "部署完成...\n"
